/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.chipchip.database;

import com.chipchip.chipchipserver.AppConfig;
import com.mongodb.Mongo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.MongoDbFactory;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.SimpleMongoDbFactory;
 
import com.mongodb.MongoClient;
import org.springframework.data.mongodb.config.AbstractMongoConfiguration;

/**
 *
 * @author Tri
 */
@Configuration
public class DBConfig extends AbstractMongoConfiguration {

    @Override
    protected String getDatabaseName() {
        return AppConfig.CONST_DB_NAME;
    }

    @Override
    public Mongo mongo() throws Exception {
        return new MongoClient(AppConfig.CONST_DB_HOST, AppConfig.CONST_DB_PORT);
    }
    
}
